﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Simple.Repository.Migrations
{
    public partial class _52 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "DataStr",
                table: "PlanDayRecipes",
                newName: "DateStr");

            migrationBuilder.AlterColumn<string>(
                name: "Date",
                table: "PlanDayRecipes",
                type: "longtext",
                nullable: false,
                comment: "日期（：2023-01-01）",
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldComment: "日期（：2023-01-01）")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "Type",
                table: "MedicationRegisterImage",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "图片类型");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Type",
                table: "MedicationRegisterImage");

            migrationBuilder.RenameColumn(
                name: "DateStr",
                table: "PlanDayRecipes",
                newName: "DataStr");

            migrationBuilder.AlterColumn<DateTime>(
                name: "Date",
                table: "PlanDayRecipes",
                type: "datetime(6)",
                nullable: false,
                comment: "日期（：2023-01-01）",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "日期（：2023-01-01）")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
